﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Automobile.service.Model;
using Automobile.service.BLL;

namespace Automobile.service.UI
{
    public partial class AddMemberCard : System.Web.UI.Page
    {
        MemberCardBll bll = new MemberCardBll();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            MemberCardModel mem = new MemberCardModel();
            mem.MemberCard_Name = this.TextBox2.Text.ToString();
            mem.MemberCard_owner = this.TextBox3.Text.ToString();
            mem.MemberCard_Cnum = this.TextBox4.Text.ToString();
            mem.MemberCard_CardID = this.TextBox5.Text.ToString();
            mem.MemberCard_ingeral = Convert.ToInt32(this.TextBox6.Text);
            mem.MemberCard_sphere = decimal.Parse(this.TextBox7.Text);
            mem.Rank_Name = this.TextBox8.Text.ToString();
            mem.MemberCard_State = this.TextBox9.Text.ToString();
            if (bll.AddMemberCard(mem) > 0)
            {
                Response.Write("<script>alert('添加成功!');location.href='MemberCard.aspx';</script>");
            }
            else
            {
                Response.Write("<script>alert('添加失败!');</script>");
            }
        }

        protected void btnBack_Click(object sender, EventArgs e)
        {
            Response.Redirect("MemberCard.aspx");
        }
    }
}